package com.manager.commons.exception;

import org.apache.log4j.Logger;
 
/**
 * 
 * Copyrights 1997-2008 ��Эͬʱ��������޹�˾<br />
 * 
 * Filename:BaseException.java<br />
 * 
 * Description:�̳�Exception �Զ����zi自定义异常类��<br />
 * 
 * Version:V0.1<br />
 * 
 * Author: zhoupeng<br />
 * 
 * History: <br />
 * [  Author 	       Date 	 Version	 Content ]<br /> 
 *   zhoupeng 	2008-08-04	  V0.1 	  create <br />
 * 
 */

public class BaseException extends Exception  { 
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** 
	 * @function: 自定义异常
	 * @param1 : className 发生异常的类名
	 * @param2 : method 发生异常的方法名
	 * @param2 : cause  异常
	 * @Description: action层出现异常在此捕获输出到控制台及log文件 
	 */

	public BaseException(String className, String method, Throwable cause) {
		super(className, cause); 
		//log文件中输出的格式为：
		Logger log = Logger.getLogger("类名：" + className + "--- 方法名："+method);
		try{
			log.info("错误信息："+cause.getMessage());
		   } catch(Exception e){ 
			   log.info("错误信息："+e.getMessage()); 
			}  
		} 
	
	public BaseException() {
		super();
	}
	
	public BaseException(String msg) {
		super(msg);
	}
	
	public BaseException(Throwable cause) {
		super(cause);
	} 
}
